package array;

public class NumberOfRectanglesThatCanFormTheLargestSquare1725 {
    public int countGoodRectangles(int[][] rectangles) {
        int result = 0;
        int max = 0;

        for (int i = 0; i < rectangles.length; i++) {
            int m = Math.min(rectangles[i][0],rectangles[i][1]);
            if(m>max){
                max = m;
                result=1;
            }else if(m==max){
                result++;
            }
        }
        return result;
    }
}
